<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" dir="ltr" class="client-nojs">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>C++ concepts: SequenceContainer - cppreference.com</title>
<meta charset="UTF-8">
<meta name="generator" content="MediaWiki 1.21.2">


<link rel="shortcut icon" href="../../../favicon.ico">



<link rel="stylesheet" href="../../../common/ext.css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" href="../../../common/site_modules.css">
<style>a:lang(ar),a:lang(ckb),a:lang(fa),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}#toc{display:none}.editsection{display:none}
/* cache key: mwiki1-mwiki_en_:resourceloader:filter:minify-css:7:472787eddcf4605d11de8c7ef047234f */</style>

<script src="../../../common/startup_scripts.js"></script>
<script>if(window.mw){
mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"cpp/concept/SequenceContainer","wgTitle":"cpp/concept/SequenceContainer","wgCurRevisionId":79545,"wgArticleId":8994,"wgIsArticle":true,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"cpp/concept/SequenceContainer","wgRestrictionEdit":[],"wgRestrictionMove":[]});
}</script><script>if(window.mw){
mw.loader.implement("user.options",function(){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"disablesuggest":0,"editfont":"default","editondblclick":0,"editsection":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":0,"extendwatchlist":0,"externaldiff":0,"externaleditor":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"justify":0,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nocache":0,"noconvertlink":0,"norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"quickbar":5,"rcdays":7,"rclimit":50,"rememberpassword":0,"rows":25,"searchlimit":20,"showhiddencats":0,"showjumplinks":1,"shownumberswatching":1,"showtoc":0,"showtoolbar":1,"skin":"cppreference2","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":0,"watchdefault":0,"watchdeletion":0,
"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,"variant":"en","language":"en","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"gadget-ColiruCompiler":1});;},{},{});mw.loader.implement("user.tokens",function(){mw.user.tokens.set({"editToken":"+\\","patrolToken":false,"watchToken":false});;},{},{});
/* cache key: mwiki1-mwiki_en_:resourceloader:filter:minify-js:7:ca03345b1e2c4d90a25d968753a73b92 */
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]);
}</script>
<style type="text/css">/*<![CDATA[*/
.source-cpp {line-height: normal;}
.source-cpp li, .source-cpp pre {
	line-height: normal; border: 0px none white;
}
/**
 * GeSHi Dynamically Generated Stylesheet
 * --------------------------------------
 * Dynamically generated stylesheet for cpp
 * CSS class: source-cpp, CSS id: 
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 * --------------------------------------
 */
.cpp.source-cpp .de1, .cpp.source-cpp .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
.cpp.source-cpp  {font-family:monospace;}
.cpp.source-cpp .imp {font-weight: bold; color: red;}
.cpp.source-cpp li, .cpp.source-cpp .li1 {font-weight: normal; vertical-align:top;}
.cpp.source-cpp .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
.cpp.source-cpp .li2 {font-weight: bold; vertical-align:top;}
.cpp.source-cpp .kw1 {color: #0000dd;}
.cpp.source-cpp .kw2 {color: #0000ff;}
.cpp.source-cpp .kw3 {color: #0000dd;}
.cpp.source-cpp .kw4 {color: #0000ff;}
.cpp.source-cpp .co1 {color: #909090;}
.cpp.source-cpp .co2 {color: #339900;}
.cpp.source-cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp.source-cpp .es0 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es1 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es2 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es3 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es4 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es5 {color: #008000; font-weight: bold;}
.cpp.source-cpp .br0 {color: #008000;}
.cpp.source-cpp .sy0 {color: #008000;}
.cpp.source-cpp .sy1 {color: #000080;}
.cpp.source-cpp .sy2 {color: #000040;}
.cpp.source-cpp .sy3 {color: #000040;}
.cpp.source-cpp .sy4 {color: #008080;}
.cpp.source-cpp .st0 {color: #008000;}
.cpp.source-cpp .nu0 {color: #000080;}
.cpp.source-cpp .nu6 {color: #000080;}
.cpp.source-cpp .nu8 {color: #000080;}
.cpp.source-cpp .nu12 {color: #000080;}
.cpp.source-cpp .nu16 {color:#000080;}
.cpp.source-cpp .nu17 {color:#000080;}
.cpp.source-cpp .nu18 {color:#000080;}
.cpp.source-cpp .nu19 {color:#000080;}
.cpp.source-cpp .ln-xtra, .cpp.source-cpp li.ln-xtra, .cpp.source-cpp div.ln-xtra {background-color: #ffc;}
.cpp.source-cpp span.xtra { display:block; }

/*]]>*/
</style>
<!--[if lt IE 7]><style type="text/css">body{behavior:url("/mwiki/skins/cppreference2/csshover.min.htc")}</style><![endif]-->
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_concept_SequenceContainer skin-cppreference2 action-view cpp-navbar">
        <!-- header -->
        
        <!-- /header -->
        <!-- content -->
        <div id="cpp-content-base">
            <div id="content">
                <a id="top"></a>
                <div id="mw-js-message" style="display:none;"></div>
                                <!-- firstHeading -->
                <h1 id="firstHeading" class="firstHeading">
<span style="font-size:0.7em; line-height:130%">C++ concepts:</span> SequenceContainer</h1>
                <!-- /firstHeading -->
                <!-- bodyContent -->
                <div id="bodyContent">
                                        <!-- tagline -->
                    <div id="siteSub">From cppreference.com</div>
                    <!-- /tagline -->
                                        <!-- subtitle -->
                    <div id="contentSub"><span class="subpages">&lt; <a href="../../cpp.html" title="cpp">cpp</a>‎ | <a href="../concept.html" title="cpp/concept">concept</a></span></div>
                    <!-- /subtitle -->
                                                            <!-- bodycontent -->
                    <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr">
<div class="t-navbar" style="">
<div class="t-navbar-sep"> </div>
<div class="t-navbar-head">
<a href="../../cpp.html" title="cpp"> C++</a><div class="t-navbar-menu"><div>
<div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em;">
<tr class="t-nv"><td colspan="5"> <a href="../language.1.html" title="cpp/language"> Language</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../header.html" title="cpp/header"> Standard library headers</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../concept.html" title="cpp/concept"> Concepts</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../utility.html" title="cpp/utility"> Utilities library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../string.html" title="cpp/string"> Strings library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../container.html" title="cpp/container"> Containers library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../algorithm.html" title="cpp/algorithm"> Algorithms library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../iterator.html" title="cpp/iterator"> Iterators library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../numeric.html" title="cpp/numeric"> Numerics library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../io.html" title="cpp/io"> Input/output library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../locale.html" title="cpp/locale"> Localizations library</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../regex.html" title="cpp/regex"> Regular expressions library</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../atomic.html" title="cpp/atomic"> Atomic operations library</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../thread.html" title="cpp/thread"> Thread support library</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../experimental.html" title="cpp/experimental"> Technical Specifications</a> </td></tr>
</table></div>
<div></div>
</div></div>
</div>
<div class="t-navbar-sep"> </div>
<div class="t-navbar-head">
<a href="../concept.html" title="cpp/concept"> C++ concepts</a><div class="t-navbar-menu"><div>
<div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv-h1"><td colspan="5"> Basic</td></tr>
<tr class="t-nv-col-table">
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="DefaultConstructible.html" title="cpp/concept/DefaultConstructible"><span class="t-lines"><span>DefaultConstructible</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="CopyAssignable.html" title="cpp/concept/CopyAssignable"><span class="t-lines"><span>CopyAssignable</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="CopyConstructible.html" title="cpp/concept/CopyConstructible"><span class="t-lines"><span>CopyConstructible</span></span></a></div></div></td></tr>
</table></div></td>
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="MoveAssignable.html" title="cpp/concept/MoveAssignable"><span class="t-lines"><span>MoveAssignable</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="MoveConstructible.html" title="cpp/concept/MoveConstructible"><span class="t-lines"><span>MoveConstructible</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="Destructible.html" title="cpp/concept/Destructible"><span class="t-lines"><span>Destructible</span></span></a></div></div></td></tr>
</table></div></td>
</tr>
<tr class="t-nv-h1"><td colspan="5"> Layout</td></tr>
<tr class="t-nv-col-table">
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="TrivialType.html" title="cpp/concept/TrivialType"><span class="t-lines"><span>TrivialType</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="TriviallyCopyable.html" title="cpp/concept/TriviallyCopyable"><span class="t-lines"><span>TriviallyCopyable</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
</table></div></td>
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="StandardLayoutType.html" title="cpp/concept/StandardLayoutType"><span class="t-lines"><span>StandardLayoutType</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="PODType.html" title="cpp/concept/PODType"><span class="t-lines"><span>PODType</span></span></a></div></div></td></tr>
</table></div></td>
</tr>
<tr class="t-nv-h1"><td colspan="5"> Library-Wide</td></tr>
<tr class="t-nv-col-table">
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="EqualityComparable.html" title="cpp/concept/EqualityComparable"><span class="t-lines"><span>EqualityComparable</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="LessThanComparable.html" title="cpp/concept/LessThanComparable"><span class="t-lines"><span>LessThanComparable</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="Swappable.html" title="cpp/concept/Swappable"><span class="t-lines"><span>Swappable</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="ValueSwappable.html" title="cpp/concept/ValueSwappable"><span class="t-lines"><span>ValueSwappable</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
</table></div></td>
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="NullablePointer.html" title="cpp/concept/NullablePointer"><span class="t-lines"><span>NullablePointer</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="Hash.html" title="cpp/concept/Hash"><span class="t-lines"><span>Hash</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="Allocator.html" title="cpp/concept/Allocator"><span class="t-lines"><span>Allocator</span></span></a></div></div></td></tr>
</table></div></td>
</tr>
<tr class="t-nv-h1"><td colspan="5"> Container</td></tr>
<tr class="t-nv-col-table">
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="Container.html" title="cpp/concept/Container"><span class="t-lines"><span>Container</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><strong class="selflink"><span class="t-lines"><span>SequenceContainer</span></span></strong></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="http%3A//en.cppreference.com/mwiki/index.php" class="new" title="cpp/concept/ContiguousContainer (page does not exist)"><span class="t-lines"><span>ContiguousContainer</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="ReversibleContainer.html" title="cpp/concept/ReversibleContainer"><span class="t-lines"><span>ReversibleContainer</span></span></a></div></div></td></tr>
</table></div></td>
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="AssociativeContainer.html" title="cpp/concept/AssociativeContainer"><span class="t-lines"><span>AssociativeContainer</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="AllocatorAwareContainer.html" title="cpp/concept/AllocatorAwareContainer"><span class="t-lines"><span>AllocatorAwareContainer</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="UnorderedAssociativeContainer.html" title="cpp/concept/UnorderedAssociativeContainer"><span class="t-lines"><span>UnorderedAssociativeContainer</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
</table></div></td>
</tr>
<tr class="t-nv-h2"><td colspan="5"> Container Elements</td></tr>
<tr class="t-nv-col-table">
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="DefaultInsertable.html" title="cpp/concept/DefaultInsertable"><span class="t-lines"><span>DefaultInsertable</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="CopyInsertable.html" title="cpp/concept/CopyInsertable"><span class="t-lines"><span>CopyInsertable</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="MoveInsertable.html" title="cpp/concept/MoveInsertable"><span class="t-lines"><span>MoveInsertable</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
</table></div></td>
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="EmplaceConstructible.html" title="cpp/concept/EmplaceConstructible"><span class="t-lines"><span>EmplaceConstructible</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="Eraseable.html" title="cpp/concept/Erasable"><span class="t-lines"><span>Erasable</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
</table></div></td>
</tr>
<tr class="t-nv-h1"><td colspan="5"> Iterator</td></tr>
<tr class="t-nv-col-table">
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="Iterator.html" title="cpp/concept/Iterator"><span class="t-lines"><span>Iterator</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="OutputIterator.html" title="cpp/concept/OutputIterator"><span class="t-lines"><span>OutputIterator</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="InputIterator.html" title="cpp/concept/InputIterator"><span class="t-lines"><span>InputIterator</span></span></a></div></div></td></tr>
</table></div></td>
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="ForwardIterator.html" title="cpp/concept/ForwardIterator"><span class="t-lines"><span>ForwardIterator</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="BidirectionalIterator.html" title="cpp/concept/BidirectionalIterator"><span class="t-lines"><span>BidirectionalIterator</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="RandomAccessIterator.html" title="cpp/concept/RandomAccessIterator"><span class="t-lines"><span>RandomAccessIterator</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="http%3A//en.cppreference.com/mwiki/index.php" class="new" title="cpp/concept/ContiguousIterator (page does not exist)"><span class="t-lines"><span>ContiguousIterator</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div>
</div></td></tr>
</table></div></td>
</tr>
<tr class="t-nv-h1"><td colspan="5"> Stream I/O</td></tr>
<tr class="t-nv-col-table">
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="FormattedInputFunction.html" title="cpp/concept/FormattedInputFunction"><span class="t-lines"><span>FormattedInputFunction</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="UnformattedInputFunction.html" title="cpp/concept/UnformattedInputFunction"><span class="t-lines"><span>UnformattedInputFunction</span></span></a></div></div></td></tr>
</table></div></td>
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="FormattedOutputFunction.html" title="cpp/concept/FormattedOutputFunction"><span class="t-lines"><span>FormattedOutputFunction</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="UnformattedOutputFunction.html" title="cpp/concept/UnformattedOutputFunction"><span class="t-lines"><span>UnformattedOutputFunction</span></span></a></div></div></td></tr>
</table></div></td>
</tr>
<tr class="t-nv-h1"><td colspan="5"> Random Numbers</td></tr>
<tr class="t-nv-col-table">
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="SeedSequence.html" title="cpp/concept/SeedSequence"><span class="t-lines"><span>SeedSequence</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="http%3A//en.cppreference.com/mwiki/index.php" class="new" title="cpp/concept/RandomNumberEngine (page does not exist)"><span class="t-lines"><span>RandomNumberEngine</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
</table></div></td>
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="RandomNumberDistribution.html" title="cpp/concept/RandomNumberDistribution"><span class="t-lines"><span>RandomNumberDistribution</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="UniformRandomNumberGenerator.html" title="cpp/concept/UniformRandomNumberGenerator"><span class="t-lines"><span>UniformRandomNumberGenerator</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="http%3A//en.cppreference.com/mwiki/index.php" class="new" title="cpp/concept/RandomNumberEngineAdaptor (page does not exist)"><span class="t-lines"><span>RandomNumberEngineAdaptor</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
</table></div></td>
</tr>
<tr class="t-nv-h1"><td colspan="5"> Concurrency</td></tr>
<tr class="t-nv-col-table">
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="BasicLockable.html" title="cpp/concept/BasicLockable"><span class="t-lines"><span>BasicLockable</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="Lockable.html" title="cpp/concept/Lockable"><span class="t-lines"><span>Lockable</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="TimedLockable.html" title="cpp/concept/TimedLockable"><span class="t-lines"><span>TimedLockable</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
</table></div></td>
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="Mutex.html" title="cpp/concept/Mutex"><span class="t-lines"><span>Mutex</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="TimedMutex.html" title="cpp/concept/TimedMutex"><span class="t-lines"><span>TimedMutex</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="SharedMutex.html" title="cpp/concept/SharedMutex"><span class="t-lines"><span>SharedMutex</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx17">(C++17)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="SharedTimedMutex.html" title="cpp/concept/SharedTimedMutex"><span class="t-lines"><span>SharedTimedMutex</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx14">(C++14)</span></span></span></div>
</div></td></tr>
</table></div></td>
</tr>
<tr class="t-nv-h1"><td colspan="5"> Other</td></tr>
<tr class="t-nv-col-table">
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="http%3A//en.cppreference.com/mwiki/index.php" class="new" title="cpp/concept/CharTraits (page does not exist)"><span class="t-lines"><span>CharTraits</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="http%3A//en.cppreference.com/mwiki/index.php" class="new" title="cpp/concept/pos type (page does not exist)"><span class="t-lines"><span>pos_type</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="http%3A//en.cppreference.com/mwiki/index.php" class="new" title="cpp/concept/off type (page does not exist)"><span class="t-lines"><span>off_type</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="Clock.html" title="cpp/concept/Clock"><span class="t-lines"><span>Clock</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="BitmaskType.html" title="cpp/concept/BitmaskType"><span class="t-lines"><span>BitmaskType</span></span></a></div></div></td></tr>
</table></div></td>
<td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="http%3A//en.cppreference.com/mwiki/index.php" class="new" title="cpp/concept/UnaryTypeTrait (page does not exist)"><span class="t-lines"><span>UnaryTypeTrait</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="http%3A//en.cppreference.com/mwiki/index.php" class="new" title="cpp/concept/BinaryTypeTrait (page does not exist)"><span class="t-lines"><span>BinaryTypeTrait</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="http%3A//en.cppreference.com/mwiki/index.php" class="new" title="cpp/concept/TransformationTrait (page does not exist)"><span class="t-lines"><span>TransformationTrait</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="TrivialClock.html" title="cpp/concept/TrivialClock"><span class="t-lines"><span>TrivialClock</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table">
<div><a href="LiteralType.html" title="cpp/concept/LiteralType"><span class="t-lines"><span>LiteralType</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div>
</div></td></tr>
</table></div></td>
</tr>
</table></div>
<div></div>
</div></div>
</div>
<div class="t-navbar-sep"> </div>
</div>
<p>A <code><b>SequenceContainer</b></code> is a <a href="Container.html" title="cpp/concept/Container"><code>Container</code></a> that stores objects of the same type in a linear arrangement.
</p>
<h3>
<span class="editsection">[<a href="http%3A//en.cppreference.com/mwiki/index.php" title="Edit section: Requirements">edit</a>]</span> <span class="mw-headline" id="Requirements">Requirements</span>
</h3>
<p>The type <code>X</code> satisfies <code>SequenceContainer</code> if
</p>
<ul><li> The type <code>X</code> satisfies <a href="Container.html" title="cpp/concept/Container"><code>Container</code></a>, and
</li></ul>
<p>Given
</p>
<ul>
<li> <code>T</code>, the element type of <code>X</code>
</li>
<li> <code>A</code>, the allocator type of <code>X</code>: <span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="sy4">::</span><span class="me2">allocator_type</span></span></span> if it exists, otherwise <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../memory/allocator.html"><span class="kw569">std::<span class="me2">allocator</span></span></a><span class="sy1">&lt;</span>T<span class="sy1">&gt;</span></span></span>
</li>
<li> <code>a</code>, <a href="../language/value_category.html" title="cpp/language/value category">rvalue</a> expression of type of type <code>X</code> 
</li>
<li> <code>p</code>, a valid const iterator into <code>a</code>
</li>
<li> <code>q</code>, a valid dereferenceable const iterator into <code>a</code>
</li>
<li> <code>q1</code> and <code>q2</code>, two const iterators into <code>a</code> such that <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="br0">[</span>q1, q2<span class="br0">)</span></span></span> is a valid range
</li>
<li> <code>i</code> and <code>j</code>, <a href="InputIterator.html" title="cpp/concept/InputIterator"><code>InputIterator</code>s</a> such that <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="br0">[</span>i, j<span class="br0">)</span></span></span> is a valid range and that the iterators refer to elements implicitly convertible to <code>value_type</code>
</li>
<li> <code>il</code>, an object of type <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../utility/initializer_list.html"><span class="kw806">std::<span class="me2">initializer_list</span></span></a><span class="sy1">&lt;</span>value_type<span class="sy1">&gt;</span></span></span>
</li>
<li> <code>n</code>, a value of type <span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="sy4">::</span><span class="me2">size_type</span></span></span>
</li>
<li> <code>t</code>, an lvalue or const rvalue of type <span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="sy4">::</span><span class="me2">value_type</span></span></span>
</li>
<li> <code>rv</code>, a non-const rvalue of type <span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="sy4">::</span><span class="me2">value_type</span></span></span>
</li>
<li> <code>Args</code>: a template parameter pack
</li>
<li> <code>args</code>: a function parameter pack with the pattern <span class="t-c"><span class="mw-geshi cpp source-cpp">Arg<span class="sy3">&amp;&amp;</span></span></span>
</li>
</ul>
<p>The following expressions must be valid and have their specified effects for all sequence containers except <span class="t-lc"><a href="../container/array.html" title="cpp/container/array">std::array</a></span>:
</p>
<table class="wikitable">
<tr>
<th>expression</th>
<th>return type</th>
<th>effects</th>
<th>precondition</th>
<th>postcondition
</th>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="br0">(</span>n, t<span class="br0">)</span></span></span>
<p><span class="t-c"><span class="mw-geshi cpp source-cpp">X a<span class="br0">(</span>n, t<span class="br0">)</span></span></span>
</p>
</td>
<td>
</td>
<td>Constructs the sequence container holding <code><b>n</b></code> copies of <code><b>t</b></code>
</td>
<td>
<code>T</code> <a href="CopyInsertable.html" title="cpp/concept/CopyInsertable"><code>CopyInsertable</code></a> into <code>X</code>
</td>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../iterator/distance.html"><span class="kw552">std::<span class="me2">distance</span></span></a><span class="br0">(</span>begin<span class="br0">(</span><span class="br0">)</span>,end<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span> <span class="sy1">==</span> n</span></span>
</td>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="br0">(</span>i, j<span class="br0">)</span></span></span>
<p><span class="t-c"><span class="mw-geshi cpp source-cpp">X a<span class="br0">(</span>i, j<span class="br0">)</span></span></span>
</p>
</td>
<td>
</td>
<td>Constructs the sequence container equal, element-wise, to the range <code>[i,j)</code>
</td>
<td> <code>T</code> is <a href="EmplaceConstructible.html" title="cpp/concept/EmplaceConstructible"><code>EmplaceConstructible</code></a> from <code>*i</code> into <code>X</code>
<p><span class="t-mark">(only for std::vector)</span> If the iterators are not <a href="ForwardIterator.html" title="cpp/concept/ForwardIterator"><code>ForwardIterator</code>s</a>, T must be <a href="CopyInsertable.html" title="cpp/concept/CopyInsertable"><code>CopyInsertable</code></a>
</p>
</td>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../iterator/distance.html"><span class="kw552">std::<span class="me2">distance</span></span></a><span class="br0">(</span>begin<span class="br0">(</span><span class="br0">)</span>,end<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span> <span class="sy1">==</span> <a href="../iterator/distance.html"><span class="kw552">std::<span class="me2">distance</span></span></a><span class="br0">(</span>i,j<span class="br0">)</span></span></span>
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="br0">(</span>il<span class="br0">)</span></span></span></td>
<td> </td>
<td> <span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="br0">(</span>il.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span>, il.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span></span></span>
</td>
<td> </td>
<td>
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a <span class="sy1">=</span> il</span></span></td>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">X<span class="sy3">&amp;</span></span></span></td>
<td>Assigns the range represented by <code><b>il</b></code> into <code><b>a</b></code><sup id="cite_ref-1" class="reference"><a href="SequenceContainer.html#cite_note-1">[1]</a></sup>
</td>
<td> T <a href="CopyInsertable.html" title="cpp/concept/CopyInsertable"><code>CopyInsertable</code></a> and <a href="CopyAssignable.html" title="cpp/concept/CopyAssignable"><code>CopyAssignable</code></a>
</td>
<td> Existing elements of <code><b>a</b></code> are destroyed or assigned to
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">emplace</span><span class="br0">(</span>p,args<span class="br0">)</span></span></span></td>
<td>
<code>iterator</code>
</td>
<td>Insert an object of type <code>T</code>, constructed with <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../utility/forward.html"><span class="kw918">std::<span class="me2">forward</span></span></a><span class="sy1">&lt;</span>Args<span class="sy1">&gt;</span><span class="br0">(</span>args<span class="br0">)</span></span></span> before <code><b>p</b></code>
</td>
<td>
<code>T</code> <a href="CopyInsertable.html" title="cpp/concept/CopyInsertable"><code>CopyInsertable</code></a>
<p><span class="t-mark">(for std::vector and std::deque)</span> <code>T</code> <a href="MoveAssignable.html" title="cpp/concept/MoveAssignable"><code>MoveAssignable</code></a> and <a href="MoveInsertable.html" title="cpp/concept/MoveInsertable"><code>MoveInsertable</code></a>
</p>
</td>
<td>Returned iterator points at the element constructed from <code>args</code> into <code>a</code>
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">insert</span><span class="br0">(</span>p,t<span class="br0">)</span></span></span></td>
<td>
<code>iterator</code>
</td>
<td>Inserts a copy of <code><b>t</b></code> before <code><b>p</b></code>
</td>
<td>
<code>T</code> <a href="CopyInsertable.html" title="cpp/concept/CopyInsertable"><code>CopyInsertable</code></a>
<p><span class="t-mark">(for std::vector and std::deque)</span> <code>T</code> <a href="CopyAssignable.html" title="cpp/concept/CopyAssignable"><code>CopyAssignable</code></a> or <a href="MoveAssignable.html" title="cpp/concept/MoveAssignable"><code>MoveAssignable</code></a>
</p>
</td>
<td>Returned iterator points at the copy of <code>t</code> inserted into <code>a</code>
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">insert</span><span class="br0">(</span>p,rv<span class="br0">)</span></span></span></td>
<td>
<code>iterator</code>
</td>
<td>Inserts a copy of <code><b>rv</b></code> before <code><b>p</b></code>, possibly using move semantics
</td>
<td>
<code>T</code> <a href="MoveInsertable.html" title="cpp/concept/MoveInsertable"><code>MoveInsertable</code></a>
<p><span class="t-mark">(for std::vector and std::deque)</span> <code>T</code> <a href="MoveAssignable.html" title="cpp/concept/MoveAssignable"><code>MoveAssignable</code></a>
</p>
</td>
<td>Returned iterator points at the copy of <code>rv</code> inserted into <code>a</code>
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">insert</span><span class="br0">(</span>p,n,t<span class="br0">)</span></span></span></td>
<td><code>iterator</code></td>
<td>Inserts <code><b>n</b></code> copies of <code><b>t</b></code> before <code><b>p</b></code>
</td>
<td>
<code>T</code> <a href="CopyInsertable.html" title="cpp/concept/CopyInsertable"><code>CopyInsertable</code></a> and <a href="CopyAssignable.html" title="cpp/concept/CopyAssignable"><code>CopyAssignable</code></a>
</td>
<td>Returned iterator points at the copy of the first element inserted into <code>a</code> or is <code>p</code> for <span class="t-c"><span class="mw-geshi cpp source-cpp">n<span class="sy1">==</span><span class="nu0">0</span></span></span>
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">insert</span><span class="br0">(</span>p,i,j<span class="br0">)</span></span></span></td>
<td><code>iterator</code></td>
<td>Inserts copies of elements in <code>[i, j)</code> before <code><b>p</b></code>
</td>
<td> T <a href="EmplaceConstructible.html" title="cpp/concept/EmplaceConstructible"><code>EmplaceConstructible</code></a> and <code><b>i</b></code> and <code><b>j</b></code> are not in <code><b>a</b></code>
<p><span class="t-mark">(only for std::vector)</span> If the iterators are not <a href="ForwardIterator.html" title="cpp/concept/ForwardIterator"><code>ForwardIterator</code>s</a>, T must be <a href="MoveInsertable.html" title="cpp/concept/MoveInsertable"><code>MoveInsertable</code></a> and <a href="MoveAssignable.html" title="cpp/concept/MoveAssignable"><code>MoveAssignable</code></a>
</p>
</td>
<td>Each iterator in <code>[i,j)</code> is dereferenced once. Returned iterator points at the copy of the first element inserted into <code>a</code> or is <code>p</code> for <span class="t-c"><span class="mw-geshi cpp source-cpp">i<span class="sy1">==</span>j</span></span>
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">insert</span><span class="br0">(</span>p, il<span class="br0">)</span></span></span></td>
<td><code>iterator</code></td>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">insert</span><span class="br0">(</span>p,il.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span>,il.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span></span></span></td>
<td> </td>
<td>Returned iterator points at the copy of the first element inserted into <code>a</code> or is <code>p</code> if <code>il</code> is empty.
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">erase</span><span class="br0">(</span>q<span class="br0">)</span></span></span></td>
<td><code>iterator</code></td>
<td>Erases the element pointed to by <code>q</code>
</td>
<td>
<span class="t-mark">(std::deque, std::vector)</span> T <a href="MoveAssignable.html" title="cpp/concept/MoveAssignable"><code>MoveAssignable</code></a>
</td>
<td>Returned iterator points at the element that was immediately following <code>q</code> prior to erasure, or <span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span></span></span> if no such element exists.
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">erase</span><span class="br0">(</span>q1,q2<span class="br0">)</span></span></span></td>
<td><code>iterator</code></td>
<td>Erases elements in <code>[p,q)</code>
</td>
<td>
<span class="t-mark">(std::deque, std::vector)</span> T <a href="MoveAssignable.html" title="cpp/concept/MoveAssignable"><code>MoveAssignable</code></a>
</td>
<td>Returned iterator points at the element that was pointed by <code>q2</code> prior to any erasure, or <span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span></span></span> if no such element exists.
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">clear</span><span class="br0">(</span><span class="br0">)</span></span></span></td>
<td><code>void</code></td>
<td>Destroys all elements in <code><b>a</b></code>
</td>
<td> </td>
<td>
<p>All references, pointers, and iterators are invalidated, including the end iterator. <span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">empty</span><span class="br0">(</span><span class="br0">)</span> <span class="sy1">==</span> <span class="kw2">true</span></span></span>. 
</p>
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">assign</span><span class="br0">(</span>i,j<span class="br0">)</span></span></span></td>
<td><code>void</code></td>
<td>Replaces elements in a with a copy of <code>[i, j)</code>
</td>
<td>
<code>T</code> <a href="EmplaceConstructible.html" title="cpp/concept/EmplaceConstructible"><code>EmplaceConstructible</code></a> and <code><b>i</b></code>, <code><b>j</b></code> not in <code><b>a</b></code>
<p><span class="t-mark">(std::vector)</span> If not <a href="ForwardIterator.html" title="cpp/concept/ForwardIterator"><code>ForwardIterator</code></a>. <code>T</code> <a href="MoveInsertable.html" title="cpp/concept/MoveInsertable"><code>MoveInsertable</code></a>
</p>
</td>
<td>Each iterator in <code>[i,j)</code> is dereferenced once
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">assign</span><span class="br0">(</span>il<span class="br0">)</span></span></span></td>
<td><code>void</code></td>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">assign</span><span class="br0">(</span>il.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span>,il.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span></span></span></td>
<td> </td>
<td>
</td>
</tr>
<tr>
<td><span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">assign</span><span class="br0">(</span>n,t<span class="br0">)</span></span></span></td>
<td>
<code>void</code>
</td>
<td>Replaces elements in <code><b>a</b></code> with <code><b>n</b></code> copies of <code><b>t</b></code>
</td>
<td>T <a href="CopyInsertable.html" title="cpp/concept/CopyInsertable"><code>CopyInsertable</code></a> and <a href="CopyAssignable.html" title="cpp/concept/CopyAssignable"><code>CopyAssignable</code></a>
</td>
<td>
</td>
</tr>
<tr>
<th colspan="5">notes
</th>
</tr>
<tr>
<td colspan="5">
<ol class="references">
<li id="cite_note-1">
<span class="mw-cite-backlink"><a href="SequenceContainer.html#cite_ref-1">↑</a></span> <span class="reference-text"><span class="t-lc"><a href="../container/array.html" title="cpp/container/array">std::array</a></span> supports assignment from a braced-init-list, but not from an <span class="t-lc"><a href="../utility/initializer_list.html" title="cpp/utility/initializer list">std::initializer_list</a></span></span>
</li>
</ol>
</td>
</tr>
</table>
<p>The following expressions must be valid and have their specified effects for the sequence containers named:
</p>
<table class="wikitable">
<tr>
<th>expression</th>
<th>return type</th>
<th>effects</th>
<th>preconditions</th>
<th>containers
</th>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">front</span><span class="br0">(</span><span class="br0">)</span></span></span>
</td>
<td>
<code>reference</code>
<p><code>const_reference</code> for const a
</p>
</td>
<td>Equivalent to <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="sy2">*</span>a.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span></span></span>
</td>
<td>
</td>
<td>(all)
</td>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">back</span><span class="br0">(</span><span class="br0">)</span></span></span>
</td>
<td>
<code>reference</code>
<p><code>const_reference</code> for const a
</p>
</td>
<td>Equivalent to <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="br0">{</span> <span class="kw4">auto</span> tmp <span class="sy1">=</span> a.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span> <span class="sy2">--</span>tmp<span class="sy4">;</span> <span class="kw1">return</span> <span class="sy2">*</span>tmp<span class="sy4">;</span> <span class="br0">}</span></span></span>
</td>
<td>
</td>
<td>
<span class="t-lc"><a href="../string/basic_string.html" title="cpp/string/basic string">std::basic_string</a></span> <span class="t-lc"><a href="../container/array.html" title="cpp/container/array">std::array</a></span> <span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">emplace_front</span><span class="br0">(</span>args<span class="br0">)</span></span></span>
</td>
<td>
<code>void</code>
</td>
<td>Prepends a <code>T</code> constructed with <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../utility/forward.html"><span class="kw918">std::<span class="me2">forward</span></span></a><span class="sy1">&lt;</span>Args<span class="sy1">&gt;</span><span class="br0">(</span>args<span class="br0">)</span>...</span></span>
</td>
<td>
<code>T</code> <a href="EmplaceConstructible.html" title="cpp/concept/EmplaceConstructible"><code>EmplaceConstructible</code></a> into <code>X</code> from <code>args</code>
</td>
<td>
<span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/forward_list.html" title="cpp/container/forward list">std::forward_list</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span>
</td>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">emplace_back</span><span class="br0">(</span>args<span class="br0">)</span></span></span>
</td>
<td>
<code>void</code>
</td>
<td>Appends a <code>T</code> constructed with <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../utility/forward.html"><span class="kw918">std::<span class="me2">forward</span></span></a><span class="sy1">&lt;</span>Args<span class="sy1">&gt;</span><span class="br0">(</span>args<span class="br0">)</span>...</span></span>
</td>
<td>
<code>T</code> <a href="EmplaceConstructible.html" title="cpp/concept/EmplaceConstructible"><code>EmplaceConstructible</code></a> into <code>X</code> from <code>args</code>
<p><span class="t-mark">(std::vector only)</span> <code>T</code> <a href="MoveInsertable.html" title="cpp/concept/MoveInsertable"><code>MoveInsertable</code></a> into <code>X</code>
</p>
</td>
<td>
<span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">push_front</span><span class="br0">(</span>t<span class="br0">)</span></span></span>
</td>
<td>
<code>void</code>
</td>
<td>Prepends a copy of <code>t</code>
</td>
<td>
<code>T</code> <a href="CopyInsertable.html" title="cpp/concept/CopyInsertable"><code>CopyInsertable</code></a> into <code>X</code>
</td>
<td>
<span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/forward_list.html" title="cpp/container/forward list">std::forward_list</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span>
</td>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">push_front</span><span class="br0">(</span>rv<span class="br0">)</span></span></span>
</td>
<td>
<code>void</code>
</td>
<td>Prepends a copy of <code>rv</code>, possibly using move semantics
</td>
<td>
<code>T</code> <a href="MoveInsertable.html" title="cpp/concept/MoveInsertable"><code>MoveInsertable</code></a> into <code>X</code>
</td>
<td>
<span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/forward_list.html" title="cpp/container/forward list">std::forward_list</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span>
</td>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">push_back</span><span class="br0">(</span>t<span class="br0">)</span></span></span>
</td>
<td>
<code>void</code>
</td>
<td>Appends a copy of <code>t</code>
</td>
<td>
<code>T</code> <a href="CopyInsertable.html" title="cpp/concept/CopyInsertable"><code>CopyInsertable</code></a> into <code>X</code>
</td>
<td>
<span class="t-lc"><a href="../string/basic_string.html" title="cpp/string/basic string">std::basic_string</a></span> <span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">push_back</span><span class="br0">(</span>rv<span class="br0">)</span></span></span>
</td>
<td>
<code>void</code>
</td>
<td>Appends a copy of <code>rv</code>, possibly using move semantics
</td>
<td>
<code>T</code> <a href="MoveInsertable.html" title="cpp/concept/MoveInsertable"><code>MoveInsertable</code></a> into <code>X</code>
</td>
<td>
<span class="t-lc"><a href="../string/basic_string.html" title="cpp/string/basic string">std::basic_string</a></span> <span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">pop_front</span><span class="br0">(</span><span class="br0">)</span></span></span>
</td>
<td>
<code>void</code>
</td>
<td>Destroys the first element.
</td>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">empty</span><span class="br0">(</span><span class="br0">)</span> <span class="sy1">==</span> <span class="kw2">false</span></span></span>
</td>
<td>
<span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/forward_list.html" title="cpp/container/forward list">std::forward_list</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span>
</td>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">pop_back</span><span class="br0">(</span><span class="br0">)</span></span></span>
</td>
<td>
<code>void</code>
</td>
<td>Destroys the last element
</td>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">empty</span><span class="br0">(</span><span class="br0">)</span> <span class="sy1">==</span> <span class="kw2">false</span></span></span>
</td>
<td>
<span class="t-lc"><a href="../string/basic_string.html" title="cpp/string/basic string">std::basic_string</a></span> <span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/list.html" title="cpp/container/list">std::list</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a<span class="br0">[</span>n<span class="br0">]</span></span></span>
</td>
<td>
<code>reference</code>
<p><code>const_reference</code> for const a
</p>
</td>
<td>Equivalent to <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="sy2">*</span><span class="br0">(</span>n <span class="sy2">+</span> a.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span></span></span>
</td>
<td>
</td>
<td>
<span class="t-lc"><a href="../string/basic_string.html" title="cpp/string/basic string">std::basic_string</a></span> <span class="t-lc"><a href="../container/array.html" title="cpp/container/array">std::array</a></span> <span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td>
</tr>
<tr>
<td>
<span class="t-c"><span class="mw-geshi cpp source-cpp">a.<span class="me1">at</span><span class="br0">(</span>n<span class="br0">)</span></span></span>
</td>
<td>
<code>reference</code>
<p><code>const_reference</code> for const a
</p>
</td>
<td>Equivalent to <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="sy2">*</span><span class="br0">(</span>n <span class="sy2">+</span> a.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span></span></span>, except that <span class="t-lc">out_of_range</span> is thrown if <span class="t-c"><span class="mw-geshi cpp source-cpp">n<span class="sy1">&gt;=</span>size<span class="br0">(</span><span class="br0">)</span></span></span>
</td>
<td>
</td>
<td>
<span class="t-lc"><a href="../string/basic_string.html" title="cpp/string/basic string">std::basic_string</a></span> <span class="t-lc"><a href="../container/array.html" title="cpp/container/array">std::array</a></span> <span class="t-lc"><a href="../container/deque.html" title="cpp/container/deque">std::deque</a></span> <span class="t-lc"><a href="../container/vector.html" title="cpp/container/vector">std::vector</a></span>
</td>
</tr>
</table>
<p>Additionally, for every sequence container, the constructor template that takes two input iterators and the member function template overloads of <code>insert()</code>, <code>append()</code>, <code>assign()</code>, <code>replace()</code> that take two input iterators do not participate in overload resolution if the their template arguments does not satisfy <a href="InputIterator.html" title="cpp/concept/InputIterator"><code>InputIterator</code></a>.
</p>
<h3>
<span class="editsection">[<a href="http%3A//en.cppreference.com/mwiki/index.php" title="Edit section: SequenceContainers in the standard library">edit</a>]</span> <span class="mw-headline" id="SequenceContainers_in_the_standard_library">SequenceContainers in the standard library</span>
</h3>
<table class="t-dsc-begin">

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../string/basic_string.html" title="cpp/string/basic string"> <span class="t-lines"><span>basic_string</span></span></a></div></div>
</td>
<td>   stores and manipulates sequences of characters <br> <span class="t-mark">(class template)</span> 
</td>
</tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div">
<div><a href="../container/array.html" title="cpp/container/array"> <span class="t-lines"><span>array</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(since C++11)</span></span></span></div>
</div>
</td>
<td>   static contiguous array  <br> <span class="t-mark">(class template)</span> 
</td>
</tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../container/vector.html" title="cpp/container/vector"> <span class="t-lines"><span>vector</span></span></a></div></div>
</td>
<td>   dynamic contiguous array <br> <span class="t-mark">(class template)</span> 
</td>
</tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../container/deque.html" title="cpp/container/deque"> <span class="t-lines"><span>deque</span></span></a></div></div>
</td>
<td>   double-ended queue <br> <span class="t-mark">(class template)</span> 
</td>
</tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div">
<div><a href="../container/forward_list.html" title="cpp/container/forward list"> <span class="t-lines"><span>forward_list</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(since C++11)</span></span></span></div>
</div>
</td>
<td>   singly-linked list  <br> <span class="t-mark">(class template)</span> 
</td>
</tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../container/list.html" title="cpp/container/list"> <span class="t-lines"><span>list</span></span></a></div></div>
</td>
<td>   doubly-linked list <br> <span class="t-mark">(class template)</span> 
</td>
</tr>
</table>
<h4>
<span class="editsection">[<a href="http%3A//en.cppreference.com/mwiki/index.php" title="Edit section: Trade-offs / usage notes">edit</a>]</span> <span class="mw-headline" id="Trade-offs_.2F_usage_notes">Trade-offs / usage notes</span>
</h4>
<table class="t-dsc-begin">

<tr class="t-dsc">
<td> std::array
</td>
<td> Fast access but fixed number of elements
</td>
</tr>


<tr class="t-dsc">
<td> std::vector
</td>
<td> Fast access but mostly inefficient insertions/deletions
</td>
</tr>


<tr class="t-dsc">
<td> std::list<br>std::forward_list
</td>
<td> Efficient insertion/deletion in the middle of the sequence
</td>
</tr>


<tr class="t-dsc">
<td> std::deque
</td>
<td> Efficient insertion/deletion at the beginning and at the end of the sequence
</td>
</tr>

</table>

<!-- 
NewPP limit report
Preprocessor visited node count: 9174/1000000
Preprocessor generated node count: 10997/1000000
Post‐expand include size: 197292/2097152 bytes
Template argument size: 34722/2097152 bytes
Highest expansion depth: 20/40
Expensive parser function count: 0/100
-->

<!-- Saved in parser cache with key mwiki1-mwiki_en_:pcache:idhash:8994-0!*!0!!*!*!* and timestamp 20150709135825 -->
</div>                    <!-- /bodycontent -->
                                        <!-- printfooter -->
                    <div class="printfooter">
                    Retrieved from "<a href="http%3A//en.cppreference.com/mwiki/index.php">http://en.cppreference.com/mwiki/index.php?title=cpp/concept/SequenceContainer&amp;oldid=79545</a>"                    </div>
                    <!-- /printfooter -->
                                                            <!-- catlinks -->
                    <div id="catlinks" class="catlinks catlinks-allhidden"></div>                    <!-- /catlinks -->
                                                            <div class="visualClear"></div>
                    <!-- debughtml -->
                                        <!-- /debughtml -->
                </div>
                <!-- /bodyContent -->
            </div>
        </div>
        <!-- /content -->
        <!-- footer -->
        
        <!-- /footer -->
        <script>if(window.mw){
mw.loader.state({"site":"loading","user":"missing","user.groups":"ready"});
}</script>
<script src="../../../common/skin_scripts.js"></script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.view.postEdit","mediawiki.user","mediawiki.page.ready","mediawiki.searchSuggest","mediawiki.hidpi","ext.gadget.ColiruCompiler"], null, true);
}</script>
<script src="../../../common/site_scripts.js"></script>

<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2828341-1']);
_gaq.push(['_setDomainName', 'cppreference.com']);
_gaq.push(['_trackPageview']);
</script><!-- Served in 0.080 secs. -->
	</body>
<!-- Cached 20150709140741 -->
</html>
